package com.eflow.engine.event;

import org.flowable.common.engine.api.delegate.event.FlowableEngineEventType;
import org.flowable.common.engine.api.delegate.event.FlowableEntityEvent;
import org.flowable.engine.delegate.event.impl.FlowableEntityEventImpl;

/**
 * @author hui se
 * @description
 * @create 2021-08-04 09:14
 **/
public class FlowableEventBuilder extends org.flowable.engine.delegate.event.impl.FlowableEventBuilder{

    public static FlowableEntityEvent createRejectedEventImplEvent(FlowableEngineEventType type, Object entity) {
        RejectedEventImpl newEvent = new RejectedEventImpl(entity, type);

        // In case an execution-context is active, populate the event fields
        // related to the execution
        populateEventWithCurrentContext(newEvent);
        return newEvent;
    }
}
